import type { ProColumns } from '@ant-design/pro-table';
import { Image } from 'antd';
import React from 'react';

export const columns: ProColumns[] = [
  {
    title: 'ID',
    key: 'id',
    dataIndex: 'id',
    hideInSearch: true,
  },
  {
    title: '封面图',
    key: 'cover_url',
    dataIndex: 'cover_url',
    hideInSearch: true,
    render: (record) => <Image width={150} src={record} />,
  },
  {
    title: '标题',
    key: 'title',
    dataIndex: 'title',
    hideInSearch: true,
  },
  {
    title: '价格',
    key: 'price',
    dataIndex: 'price',
    hideInSearch: false,
  },
  {
    title: '销量',
    key: 'sales',
    dataIndex: 'sales',
    hideInSearch: false,
  },
  {
    title: '描述',
    key: 'description',
    dataIndex: 'description',
    hideInSearch: true,
  },
  // {
  //   title: '详情',
  //   key: 'details',
  //   dataIndex: 'details',
  //   hideInSearch: true,
  // },
  {
    title: '创建时间',
    key: 'showTime',
    dataIndex: 'created_at',
    valueType: 'dateTime',
    sorter: true,
    hideInSearch: true,
  },
];
